<?php 
namespace app\model;

use think\Model;
use think\Db;

class Cash extends Model{
	public static function getListByPage($num){
		$res = Db::name('cash ca')
				->field("u.user_name,u.user_id,cash_id,ca.cash_num,ca.gmt_create")					
				->join("user u","ca.user_id = u.user_id and u.is_delete=0")
				->where([
					"ca.is_delete"=>0,
					"ca.is_pass"=>0,
				])
				->order("ca.gmt_create desc")
				->paginate($num);
		return $res;
	}

	public static function getPassByPage($num){
		$res = Db::name('cash ca')
				->field("u.user_name,a.admin_name,u.user_id,cash_id,ca.cash_num,ca.gmt_create,ca.gmt_pass")
				->join("user u","ca.user_id = u.user_id and u.is_delete=0")
				->join("admin a","ca.admin_id = a.admin_id")
				->where([
					"ca.is_delete"=>0,
					"ca.is_pass"=>1,
				])
				->order("ca.gmt_pass desc")
				->paginate($num);
		return $res;
	}

}

 ?>